s = 0
'''
空心菱形
  *
 * *
*   *
 * *
  *
观察可得知，只需要在最外圈描边即可，只要在菱形的基础上控制边缘输出即可 
'''
while True:
    row = eval(input('请输入菱形的行数'))
    if row % 2 == 0:
        print('请输入奇数行')
    else:
        break
top_row = (row + 1) // 2

for i in range(1, row + 1):
    if i <= top_row:
        for j in range(1, (top_row + 1 - i)):
            print(' ', end='')
        for j in range(1, 2 * i):
            if j == 1 or j == 2 * i - 1:
                print('*', end='')
            else:
                print(' ', end='')
    else:
        for j in range(1, i - top_row + 1):
            print(' ', end='')
        # for j in range(1, row + 1 - 2 * (i - top_row)): # 通项公式：行数99+公差2-2行
        for j in range(1, 2 * row + 2 - 2 * i):  # 通项公式：行数99+公差2-2行
            if j == 1 or j == 2 * row + 2 - 2 * i - 1:
                print('*', end='')
            else:
                print(' ', end='')

    print()
